import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex);

const state = {
  name: 'w.dehai',
  password: 123456
}

const getters = {
  getName () {
    return state.name
  },
  getPassword () {
    return state.password
  }
}

const mutations = {
  setName (state, name) {
    state.name = name
  },
  setPassword (state, password) {
    state.password = password
  }
}

const store = new Vuex.Store({
  state,
  getters,
  mutations
})

export default store